package lv.accenture.ex06;

import java.util.List;

public class Bookmark {
	
	private String url;
	private String title;
	private String description;
	
	private String uid;

	private String creator;
	private String year;
	private List<String> tags;
	
	
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getCreator() {
		return creator;
	}
	
	public void setCreator(String creator) {
		this.creator = creator;
	}
	public String getYear() {
		return year;
	}
	public void setYear(String year) {
		this.year = year;
	}
	public List<String> getTags() {
		return tags;
	}
	
	public void setTags(List<String> tags) {
		this.tags = tags;
	}
	public String getUid() {
		return uid;
	}
	public void setUid(String uid) {
		this.uid = uid;
	}
	
	public String toString() {
		StringBuffer result = new StringBuffer();
		result.append("{ type : \"Bookmark\",\n");
		
		result.append("label : \"");
			result.append(getTitle());
				result.append("\",\n");
		result.append("url : \"");
			result.append(getUrl());
				result.append("\",\n");
		result.append("description : \" ");
			result.append(getDescription());
				result.append("\",\n");
		result.append("uid : \"");
			result.append(getUid());
				result.append("\",\n");
		result.append("creator : \"");
			result.append(getCreator());
				result.append("\",\n");
		result.append("year : \"");
			result.append(getYear());
				result.append("\",\n");
		result.append("tags : [");
		
		for(String s : getTags()) {
			result.append( "\"" + s +"\", ");
		}
		
		result = new StringBuffer(result.substring(0, result.length()-2));
		result.append("]\n");
		result.append("}");
		return result.toString();
	}
}
